set DESTDIR="."

If "%1" Neq "" (
	set DESTDIR=%1
)

del WebLib.zip
set ERRORS=0

echo Create directory
rem rd %DESTDIR% /S /Q > nul
mkdir %DESTDIR%\Temp

xcopy DotNetNuke\DesktopModules\WebLib\01.00.00.SqlDataProvider %DESTDIR%\Temp /C /I /Y < nul > nul
if not %ERRORLEVEL% == 0 set ERRORS=1
xcopy DotNetNuke\DesktopModules\WebLib\01.00.10.SqlDataProvider %DESTDIR%\Temp /C /I /Y < nul > nul
if not %ERRORLEVEL% == 0 set ERRORS=2
xcopy DotNetNuke\DesktopModules\WebLib\Uninstall.SqlDataProvider %DESTDIR%\Temp /C /I /Y < nul > nul
if not %ERRORLEVEL% == 0 set ERRORS=3
xcopy DotNetNuke\DesktopModules\WebLib\DisplayBinaryData.ascx %DESTDIR%\Temp /C /I /Y < nul > nul
if not %ERRORLEVEL% == 0 set ERRORS=4
xcopy DotNetNuke\DesktopModules\WebLib\Settings.ascx %DESTDIR%\Temp /C /I /Y < nul > nul
if not %ERRORLEVEL% == 0 set ERRORS=5
xcopy DotNetNuke\DesktopModules\WebLib\EditDocuments.ascx %DESTDIR%\Temp /C /I /Y < nul > nul
if not %ERRORLEVEL% == 0 set ERRORS=6
xcopy DotNetNuke\DesktopModules\WebLib\Documents.ascx %DESTDIR%\Temp /C /I /Y < nul > nul
if not %ERRORLEVEL% == 0 set ERRORS=7
xcopy DotNetNuke\DesktopModules\WebLib\WebLib.dnn %DESTDIR%\Temp /C /I /Y < nul > nul
if not %ERRORLEVEL% == 0 set ERRORS=8
xcopy DotNetNuke\DesktopModules\WebLib\App_LocalResources\*.resx %DESTDIR%\Temp /C /I /Y < nul > nul
if not %ERRORLEVEL% == 0 set ERRORS=9
xcopy DotNetNuke\bin\Jfc007.WebLib.SQLDataProvider.dll %DESTDIR%\Temp /C /I /Y < nul > nul
if not %ERRORLEVEL% == 0 set ERRORS=10
xcopy DotNetNuke\bin\Jfc007.WebLib.dll %DESTDIR%\Temp /C /I /Y < nul > nul
if not %ERRORLEVEL% == 0 set ERRORS=11
xcopy DotNetNuke\bin\Jfc007.WebLib.Pop3.dll %DESTDIR%\Temp /C /I /Y < nul > nul
if not %ERRORLEVEL% == 0 set ERRORS=12
xcopy DotNetNuke\DesktopModules\WebLib\01.00.14.SqlDataProvider %DESTDIR%\Temp /C /I /Y < nul > nul
if not %ERRORLEVEL% == 0 set ERRORS=13
xcopy DotNetNuke\DesktopModules\WebLib\MainPanel.ascx %DESTDIR%\Temp /C /I /Y < nul > nul
if not %ERRORLEVEL% == 0 set ERRORS=14
xcopy DotNetNuke\DesktopModules\WebLib\Categories.ascx %DESTDIR%\Temp /C /I /Y < nul > nul
if not %ERRORLEVEL% == 0 set ERRORS=15
xcopy DotNetNuke\DesktopModules\WebLib\01.00.11.SqlDataProvider %DESTDIR%\Temp /C /I /Y < nul > nul
if not %ERRORLEVEL% == 0 set ERRORS=16
xcopy DotNetNuke\DesktopModules\WebLib\Images\*.* %DESTDIR%\Temp /C /I /Y < nul > nul
if not %ERRORLEVEL% == 0 set ERRORS=17
xcopy DotNetNuke\DesktopModules\WebLib\Actions.ascx %DESTDIR%\Temp /C /I /Y < nul > nul
if not %ERRORLEVEL% == 0 set ERRORS=18
xcopy DotNetNuke\DesktopModules\WebLib\Stars.ascx %DESTDIR%\Temp /C /I /Y < nul > nul
if not %ERRORLEVEL% == 0 set ERRORS=19
"c:\Program Files\7-Zip\7z.exe" a -tzip %DESTDIR%\WebLib.Zip %DESTDIR%\Temp\*.*
if not %ERRORLEVEL% == 0 set ERRORS=13

rmdir %DESTDIR%\Temp /s /q
if not %ERRORLEVEL% == 0 set ERRORS=14

if not %ERRORS% == 0 echo Errors occured

rem exit %ERRORS%

